Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Gallery): add Gallery component #247

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat(Gallery): add Gallery component #247

wants to merge 1 commit into from

Conversation

kseniya57
Copy link
Contributor

Add the components for rendering galleries (base gallery and the files gallery with file previews and some pre-defined active file renderers)

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@@ -0,0 +1,18 @@
import React from 'react';

import {FilePreview} from '../../FilePreview';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use FIlePreview component from gravity-ui/uikit. Current component will be removed in next major

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-12-16 at 12 10 44

There is no such export.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need version 6.35.0 of uikit(

Copy link
Contributor

@mournfulCoroner mournfulCoroner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's impossible to interact with video after its panel is gone. Hover does not work and click switches the file. Is that how it's supposed to work?

@korvin89
Copy link
Contributor

@kseniya57 Do we have rfc fo this components?

@kseniya57
Copy link
Contributor Author

@kseniya57

Yes

@kseniya57 kseniya57 force-pushed the gallery branch 3 times, most recently from 401a5d6 to 8c07955 Compare December 19, 2024 05:43
@kseniya57 kseniya57 force-pushed the gallery branch 2 times, most recently from 855b632 to 772a07f Compare December 26, 2024 07:54
@kseniya57 kseniya57 changed the title feat(Gallery): add Gallery and FilesGallery components feat(Gallery): add Gallery component Dec 26, 2024
@mournfulCoroner mournfulCoroner removed the request for review from KirillDyachkovskiy January 15, 2025 15:31
const activeItem = items[activeItemIndex] || items[0];

if (!items.length) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth considering a empty state. It's strange when the modal just doesn't appear when you try to open it through a prop.

$filePreviewBlock: '.#{variables.$ns}file-preview';

#{$block} {
.g-modal__content-wrapper {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be used var --g-modal-margin from public css api

&_mode_full-screen {
overflow: hidden;

.g-modal__content-wrapper,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be used var --g-modal-border-radius


import {GalleryFile, files, images} from './mockData';

export default {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be great to see examples of custom actions and a case with а FallbackText in storybook

type: 'document',
url: 'https://preview.gravity-ui.com/icons',
name: 'Html page',
interactive: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interactive: true but in storybook buttons are still working
image

<img
className={cnImageView(null, className)}
src={src}
alt=""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add alt to the props?

src/components/Gallery/Gallery.tsx Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants